<?php
require('validate.php');

$filename = 'highscores.txt';
$r10_filename = "highscores10.txt";
$r20_filename = "highscores20.txt";
$r30_filename = "highscores30.txt";

// Load a different file based on how many rounds was passed.
if ($_POST['r'] == 30) {
	$filename = $r30_filename;
} else if ($_POST['r'] == 20) {
	$filename = $r20_filename;
} else {
	$filename = $r10_filename;
}

// Get a file into an array.  
$lines = file($filename);

// Loop through our array and build a string to pass back to Flash.
foreach ($lines as $line_num => $line) {
	echo "&rawScores=" . $line;
}

?>